Skip to content

deploy: keep the isolated Bot Social TRUST_PROXY default one the service accepts - #3499

Merged
Birfy merged 2 commits into
mainfrom
dev/3498-bot-social-trust-proxy-default
Dec 2, 2026
Merged

Birfy merged 2 commits into
mainfrom
dev/3498-bot-social-trust-proxy-default

Conversation

@Birfy

@Birfy Birfy commented Dec 2, 2026 •

Copy link
Copy Markdown
Collaborator

What changed

The isolated overlay's TRUST_PROXY default mixed loopback with RFC1918 address entries, and loadTrustProxy refuses that combination by design: the refusal is thrown at module load (services/bot-social/src/main.ts:29), before the server listens, so the container exits 1 and restart: unless-stopped turns that into an endless restart loop with /healthz never answering.

  • deploy/isolated/bot-social.compose.yml: the default is now the three RFC1918 ranges the overlay actually needs; loopback is gone.
  • services/bot-social/test/trust_proxy.test.ts: new test that reads the overlay's TRUST_PROXY default out of the Compose file and asserts loadTrustProxy accepts it as a CIDR list. The YAML-parsing test and the parser test existed separately and were never joined, which is why CI stayed green while the documented deployment could not start.

Nothing else changes: the parser's rule is right, and the documented procedure stays as it is.

Evidence (local on this host, not CI)

Replayed on a clean 0bdbbfbe7cc5b77c78f84adc7b9e78e86aba9fb2 tarball; the rebuilt base tree is aacdf8ea529f4355cfb72e87a73cf4eb21861ca9. Slice tree 6d9ddd362fcc293a58955631e91f16ab84c55027, commit 9dfee9b3, 2 files +16/-1.

  • With the slice: node --import tsx --test test/trust_proxy.test.ts -> 11/11 pass.
  • Negative control: loopback back in the overlay default -> not ok 11 - the isolated Bot Social overlay's TRUST_PROXY default is one the service accepts, error TRUST_PROXY cannot mix false or loopback with address entries (got "172.16.0.0/12,10.0.0.0/8,192.168.0.0/16,loopback"). Restored -> 11/11 pass.
  • python3 -m unittest test_isolated_bot_social -> OK.
  • grep -rn "192.168.0.0/16,loopback" matches nowhere else in the repository.

Provenance

services/bot-social/test/trust_proxy.test.ts comes from the Bot Social snapshot, so changing it is recorded rather than silently allowed: it moves out of docs/upstream/bot-social-files.json into modified_files in docs/upstream/migration-manifest.json with the original sha256 and blob kept, plus the reason and the licence notice, and the component's file_count drops from 436 to 435.

python3 scripts/verify-upstream-migration.py -> ok (flybot 46 files, bot-social 435 files).

Refs #3498

…ice accepts

The overlay defaulted TRUST_PROXY to a list that also contained loopback, and
loadTrustProxy refuses to mix loopback with address entries. The refusal is
thrown at module load, before listen, so the container exited 1 and restarted
forever with /healthz never answering.

- drop the loopback token from the overlay default
- join the two halves in trust_proxy.test.ts: read the overlay's TRUST_PROXY
  default and assert loadTrustProxy accepts it, so the default cannot drift
  back to one the service rejects

Refs #3498
@github-actions github-actions Bot added the risk:T3 Risk tier T3 (needs a human approval), set by the controller from the diff label Dec 2, 2026
…ifest

The overlay-default test changes a file that comes from the Bot Social
snapshot, so it moves from the identical-file list to modified_files with the
original hash kept, and the component file count follows it down by one.

Refs #3498
@Birfy

Birfy commented Dec 2, 2026

Copy link
Copy Markdown
Collaborator Author

Reviewed at head 8c5bda659f57d3a17f723f2ccd9c5ead6793303f (tree 12d08f974f7d137c151240f5018acb972135a245, 4 files +27/-8, base 0bdbbfbe).

  • Local, not CI: node --import tsx --test test/trust_proxy.test.ts 11/11 pass; negative control (put loopback back into the default) fails with the parser's own message, then restores; python3 -m unittest test_upstream_migration test_isolated_bot_social 8 tests OK once the local node_modules from npm ci is removed (the verifier flags it as unexpected files, which is local noise); scripts/verify-upstream-migration.py rc 0.
  • CI on this exact head: 18/18 success, all completed. That is CI green for the head, not for the merge commit.
  • risk:T3 was applied by risk-gate, not by hand. It comes from the deploy/ path. Merging it is my call and it is recorded here: the change is a compose default plus a test and provenance records, no code that runs in the shipped image, and the tree that the queue will produce was predicted locally on top of 2fc33831 (9462d28b) with the verifier green there as well.

Refs #3498

@Birfy
Birfy added this pull request to the merge queue Dec 2, 2026
Merged via the queue into main with commit 766e978 Dec 2, 2026
18 checks passed
@Birfy
Birfy deleted the dev/3498-bot-social-trust-proxy-default branch December 2, 2026 07:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:T3 Risk tier T3 (needs a human approval), set by the controller from the diff

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant